import sys
# 设置模块的搜索的路径
sys.path.append('../base')
# 导入base包
from base import Base
# 导入页面配置信息
import settings
# 定义登录页面类，继承Base类
class PageLogin(Base):
    def page_input_username(self, username):  # 输入用户名
        self.base_input(settings.username, username)
    def page_input_password(self, password): # 输入密码
        self.base_input(settings.password, password)
    def page_click_login_btn(self): # 点击登录
        self.base_click(settings.login_button)
    def page_login(self, username, password):
        self.page_input_username(username)
        self.page_input_password(password)
        self.page_click_login_btn()
    # 获取登录结果
    def page_get_text(self):
        return self.base_get_text(settings.login_result)
if __name__ == '__main__':
    login = PageLogin()
    login.page_login('admin', '888999')
    result = login.page_get_text()
    print('结果：', result)
    from time import sleep
    sleep(3)
    login.base_close()




